home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 November / PCWorld_2007-11_cd.bin / v cisle / winuae / InstallWinUAE1440.exe / Amiga Programs / uae-configuration.c < prev    next >
C/C++ Source or Header  |  2004-08-17  |  1KB  |  67 lines

  1.  
  2. #define __NOLIBBASE__
  3. #include <proto/exec.h>
  4. #include <proto/dos.h>
  5.  
  6. #define OUTBUFSIZE 1000
  7.  
  8. long (*UaeConf) (...);
  9.  
  10. struct Library *SysBase;
  11. struct Library *DOSBase;
  12.  
  13. char outbuf[OUTBUFSIZE+1];
  14.  
  15. __saveds long start (register __a0 param,register __d0 paramlen)
  16. {
  17.     long rc = 20;
  18.     long index;
  19.     BPTR out;
  20.     char *s;
  21.     BOOL brk = FALSE;
  22.  
  23.     UaeConf = (void *) 0xf0ff60;
  24.  
  25.     SysBase = *((struct Library **)4);
  26.  
  27.     if (DOSBase = OpenLibrary ("dos.library",0))
  28.     {
  29.         out = Output();
  30.  
  31.         if (*((ULONG *)UaeConf))
  32.         {
  33.             index = -1;
  34.  
  35.             do    {
  36.                 outbuf[0] = 0;
  37.                 rc = UaeConf (82,index,param,paramlen,outbuf,OUTBUFSIZE);
  38.  
  39.                 if (outbuf[0] && out)
  40.                 {
  41.                     for (s = outbuf; *s; s++);
  42.                     *s++ = '\n';
  43.                     Write (out,outbuf,s - outbuf);
  44.                 }
  45.  
  46.                 index++;
  47.                 if (SetSignal(0,0) & SIGBREAKF_CTRL_C)
  48.                     brk = TRUE;
  49.             } while (!brk && rc < 0);
  50.  
  51.             if (brk && out)
  52.             {
  53.                 Write (out,"*** Break\n",10);
  54.                 rc = 10;
  55.             }
  56.  
  57.         }
  58.         else
  59.             if (out)
  60.                 Write (out,"Your version of WinUAE is too old\n",34);
  61.  
  62.         CloseLibrary (DOSBase);
  63.     }
  64.  
  65.     return (rc);
  66. }
  67.